﻿<#include "../common/layout.ftl"/>
<@layout>
<div class="well">
	<span class="label label-success">分公司基本信息设置</span>
</div>
<div class="well">	
	<form id="form1" class="well form-horizontal" action="../telEidtOK"  method="post">

		<input type="hidden" id="id" name="id" value="${id}">
      <div class="control-group">
        <label class="control-label" for="focusedInput">员工联系电话：</label>
        <div class="controls" >
          <input class="input-xlarge focused" name="tel" id="tel" type="text" style="height: 26" value="${tel}" >
        </div>
      </div>
       <div class="control-group">
        <label class="control-label" for="focusedInput">公司代码：</label>
        <div class="controls" >
          <#if session.userRole == 'admin'>
	          <input class="input-xlarge focused" name="company" id="company" type="text"  style="height: 26" value="${company!""}">
	      <#else>
	          ${company!""}
          </#if>
        </div>
      </div>
      <div class="control-group">
        <label class="control-label" for="focusedInput">公司名称：</label>
        <div class="controls" >
          <#if session.userRole == 'admin'>
          	   <input class="input-xlarge focused" name="companyname" id="companyname" type="text" value="${companyname!""}" style="height: 26">
          <#else>
	          ${companyname!""}
          </#if>
        </div>
      </div>
      <!--<div class="control-group">
        <label class="control-label" for="sun_company">子公司名称：</label>
        <div class="controls" >
          <#if session.userRole == 'admin'>
          	<input class="input-xlarge focused" name="sun_company" id="sun_company" type="text" value="${sun_company!""}" style="height: 26">
          <#else>
	          ${sun_company!""}
          </#if>
        </div>
      </div>-->
      <div class="control-group">
        <label class="control-label" for="companyName">负责人名称：</label>
        <div class="controls" >
          <input class="input-xlarge focused" name="user_name" id="user_name" type="text" value="${user_name!""}" style="height: 26" >
        </div>
      </div>
      <div class="control-group">
        <label class="control-label" for="companyName">负责人电话：</label>
        <div class="controls" >
          <input class="input-xlarge focused" name="user_phone" id="user_phone" type="text" value="${user_phone!""}" style="height: 26" >
        </div>
      </div>
      <div class="control-group">
        <label class="control-label" for="focusedInput">所在城市：</label>
        <div class="controls" >
            <select class="input-xlarge focused" name="new_city_id" id="new_city_id">
	           <option value="">--请选择城市--</option>
	           <#list citys as city>
	               <#if newCityId??>
		               <option value="${city.id!""}" <#if city.id == newCityId>selected="selected"</#if>>${city.city_name!""}</option>
	               <#else>
	                   <option value="${city.id!""}">${city.city_name!""}</option>
	               </#if>
	           </#list>
	        </select>
        </div>
      </div>
      <!--
      <div class="control-group">
        <label class="control-label" for="focusedInput">定价：</label>
        <div class="controls" >
          <input class="input-xlarge focused" name="price" id="price" type="text" value="${price!""}" style="height: 26" >元
        </div>
      </div> -->
      <div class="control-group">
        <label class="control-label">提成类型：</label>
        <div class="controls">
         <input type="radio" <#if commissiontype == 1>checked</#if> name="commissiontype" value="1">可降比例扣款（<a target="_blank" href="http://www.zglbapp.com/esite/zglbapp/default1.aspx?lan=gb&catid=37028&contentid=40394">扣款说明</a>）
         <input type="radio" <#if commissiontype == 2>checked</#if> name="commissiontype" value="2">固定比例提成
         <input type="radio" <#if commissiontype == 3>checked</#if> name="commissiontype" value="3">使用按天提成
        </div>
      </div>
      <div class="control-group fixedmoney" style="display:none">
        <label class="control-label" for="fixedmoney">提成(固定)：</label>
        <div class="controls" >
          <input class="focused" name="fixedmoney" id="fixedmoney" value="${fixedmoney!""}" type="text"  style="height: 26" >元
        </div>
      </div>
      <div class="control-group proportion" style="<#if commissiontype != 2>display:none</#if>">
        <label class="control-label" for="proportion">提成(比例)：</label>
        <div class="controls" >
          <input class="focused" name="proportion" id="proportion" value="${proportion!""}" type="text"  style="height: 26" >%
        </div>
      </div>
      <div class="control-group daymoney" style="<#if commissiontype != 3>display:none</#if>">
        <label class="control-label" for="daymoney">按天提成(固定)：</label>
        <div class="controls" >
          <input class="focused" name="daymoney" id="daymoney" value="${daymoney!""}" type="text"  style="height: 26" >元
        </div>
      </div>
      <div class="control-group">
        <label class="control-label" for="lowerthanmoney">低于：</label>
        <div class="controls">
          <input class="focused" name="lowerthanmoney" id="lowerthanmoney" value="${lowerthanmoney!""}" type="text"  style="height: 26" >元
        </div>
      </div>
      <div class="control-group">
        <label class="control-label" for="commissionmoney">提成：</label>
        <div class="controls">
          <input class="focused" name="commissionmoney" id="commissionmoney" value="${commissionmoney!""}" type="text"  style="height: 26" >元
        </div>
      </div>
      <!--
      <div class="control-group">
        <label class="control-label">公司id：</label>
        <div class="controls">
          <#if session.userRole == 'admin'>
          	  <input class="focused" name="city_id" id="city_id" type="text" value="${city_id!"0"}" style="height: 26" >
          <#else>
	          ${city_id!""}
          </#if>
        </div>
      </div>
      -->
      <div class="control-group">
        <label class="control-label">代叫提成比例：</label>
        <div class="controls">
          <input class="focused" name="call_proportion" id="call_proportion" type="text" value="${call_proportion!"0"}" style="height: 26" >
        </div>
      </div>
      <#if session.userRole == 'admin'>
	      <div class="control-group">
	        <label class="control-label">短信条数：</label>
	        <div class="controls">
	          <input class="focused" name="message_num" id="message_num" type="text" value="${message_num!"0"}" style="height: 26" >
	        </div>
	      </div>
      </#if>
      <div class="control-group">
        <label class="control-label">客户联系电话：</label>
        <div class="controls">
          <input class="focused" name="client_phone" id="client_phone" type="text" value="${client_phone!""}" style="height: 26" >
        </div>
      </div>
      <div class="control-group">
        <label class="control-label">员工最小接单金额：</label>
        <div class="controls">
          <input class="focused" name="driver_limit_amt" id="driver_limit_amt" type="text" value="${driver_limit_amt!""}" style="height: 26" >
        </div>
      </div>
      <div class="control-group">
        <label class="control-label">保险金额：</label>
        <div class="controls">
          <input class="focused" name="safe_money" id="safe_money" type="text" value="${safe_money!0}" style="height: 26" >
        </div>
      </div>
      <div class="form-actions">
        <button type="submit" class="btn btn-primary" >确 定</button>
        <button type="reset" class="btn">重 置</button>
        <button type="button" class="btn btn-info" onclick="javascript:history.back();">返回</button>
      </div>
  </form>
  </div>

<script>
	$(function() { 
	
	$("input[name='commissiontype']").click(function(){
     	var type = $(this).val();
     	if(type=='1'){
     		//$(".fixedmoney").show();
     		$(".proportion").hide();
     		$(".daymoney").hide();
     	}else if(type=='2'){
     		$(".fixedmoney").hide();
     		$(".daymoney").hide();
     		$(".proportion").show();
     	}else if(type=='3'){
     		$(".daymoney").show();
     		$(".fixedmoney").hide();
     		$(".proportion").hide();
     	}
     })
	
     $("#form1").validity(function() {
         $("#tel").require();
         $("#company").require();
     });
     
 }); 
</script>
</@layout>